﻿using System;
using System.Linq;
using FranceTriple.Dal;
using TeamFranceTriple.Config;

namespace TeamFranceTriple
{
    public partial class NextUserBirthday : BaseUserControl
    {
        private static Int32 MaxUser = TeamFranceTripleConfig.WebConfig.NextUserBirthday.MaxNumberOfUser;

        protected void Page_Load(object sender, EventArgs e)
        {
            this.Visible = ThisMaster.RequesterRoles.Contains("Member");

            TodayBirthDayBulletedList.DataSource = UserProfile.GetTodayBirthday();
            TodayBirthDayBulletedList.DataBind();

            NextBirthDayBulletedList.DataSource = UserProfile.GetNextUserBirthday(MaxUser);
            NextBirthDayBulletedList.DataBind();

            HappyBirthdayLabel.Visible = (TodayBirthDayBulletedList.Items.Count > 0);
        }
    }
}